package com.baizhi.entity;

import com.alibaba.fastjson.annotation.JSONField;
import org.springframework.format.annotation.DateTimeFormat;

import java.util.Date;
import java.util.List;

public class Item {
    private Integer itemId;

    private Integer bookId;

    private Integer count;
    //
    @DateTimeFormat(pattern = "yyyy-MM-dd")
    @JSONField(format = "yyyy-MM-dd")
    private Date itemDate;

    private Integer orderId;

    private Order order;

    private Book book;

    private List<Book> books;

    public Item(Integer itemId, Integer count, Date itemDate, Order order, Book book) {
		super();
		this.itemId = itemId;
		this.count = count;
		this.itemDate = itemDate;
		this.order = order;
		this.book = book;
	}

	public Item(Integer itemId, Integer bookId, Integer count, Date itemDate, Integer orderId) {
        this.itemId = itemId;
        this.bookId = bookId;
        this.count = count;
        this.itemDate = itemDate;
        this.orderId = orderId;
    }

    public Item() {
        super();
    }

	public List<Book> getBooks() {
		return books;
	}

	public void setBooks(List<Book> books) {
		this.books = books;
	}

	public Order getOrder() {
		return order;
	}

	public void setOrder(Order order) {
		this.order = order;
	}

	public Book getBook() {
		return book;
	}

	public void setBook(Book book) {
		this.book = book;
	}

	public Integer getItemId() {
        return itemId;
    }

    public void setItemId(Integer itemId) {
        this.itemId = itemId;
    }

    public Integer getBookId() {
        return bookId;
    }

    public void setBookId(Integer bookId) {
        this.bookId = bookId;
    }

    public Integer getCount() {
        return count;
    }

    public void setCount(Integer count) {
        this.count = count;
    }

    public Date getItemDate() {
        return itemDate;
    }

    public void setItemDate(Date itemDate) {
        this.itemDate = itemDate;
    }

    public Integer getOrderId() {
        return orderId;
    }

    public void setOrderId(Integer orderId) {
        this.orderId = orderId;
    }

	public Item(Integer itemId, Integer count, Date itemDate, Integer orderId, Book book) {
		super();
		this.itemId = itemId;
		this.count = count;
		this.itemDate = itemDate;
		this.orderId = orderId;
		this.book = book;
	}

	@Override
	public String toString() {
		return "Item [itemId=" + itemId + ", count=" + count + ", itemDate=" + itemDate + ", orderId=" + orderId
				+ ", book=" + book + "]";
	}


}